package com.copa.l509;

/**
 * @author copa
 * @createDate 2022-06-28 17:22
 * @function 递归法
 */
public class Test1 {

    public int fib(int n) {
        if (n < 2) {
            return n == 1 ? 1 : 0;
        }
        return fib(n - 1) + fib(n - 2);
    }

    public static void main(String[] args) {
        System.out.println(new Test1().fib(5));
    }
}
